﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MIC_Interfaces
{
    class Program
    {
        static void Main(string[] args)
        {
            Square s1 = new Square(1.5f);
            PrintLog(s1);

            Triangle t1 = new Triangle(2.1f);
            PrintLog(t1);

            Console.ReadKey();
        }

        static void PrintLog(IRegularPolygon polygon)
        {
            try
            {
                Console.WriteLine("Sides Count: {0}", polygon.SidesCount);
                Console.WriteLine("Side Length: {0}", polygon.SideLength);
                Console.WriteLine("Area: {0}", polygon.GetArea());
                Console.WriteLine("Perimeter: {0}", polygon.GetPerimeter());
            }
            catch (NotImplementedException e)
            {
                Console.WriteLine(e.Message);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
            finally
            {
                Console.WriteLine("------------------------");
            }
        }
    }
}
